package com.qf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.pojo.DtsCategory;
import com.qf.vo.CatVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 类目表 Mapper 接口
 * </p>
 *
 * @author zhaojian
 * @since 2021-05-12
 */
public interface DtsCategoryMapper extends BaseMapper<DtsCategory> {


      @Select("SELECT c.id value, c.`name` label " +
            " from dts_category c WHERE pid =0")
    public List<CatVo> category1();

    @Select("SELECT c.pid `value`,c.`name` label " +
            " from dts_category c where pid =#{id}")
    public List<CatVo> category2( Integer id);

@Select(" SELECT c.id as`value` , c.`name` as label " +
        " from dts_category c  WHERE c.`level` = \"l1\"")
    public  List<CatVo> query();
}
